import request from '@/utils/Request'
import { stringify } from 'qs';

export async function getList(params) {
  return request(`/joker/permissions/queryList?${stringify(params)}`, {
    method: 'GET'
  });
}

export async function queryAll(params) {
  return request(`/joker/permissions/queryAll?${stringify(params)}`, {
    method: 'GET'
  });
}

export async function deleteById(params) {
  return request(`/joker/permissions/delete?${stringify(params)}`, {
    method: 'GET'
  });
}

export async function updatePermission(params) {
  return request('/joker/permissions/update', {
    method: 'POST',
    data: {
      ...params
    }
  });
}

export async function addPermission(params) {
  return request('/joker/permissions/add', {
    method: 'POST',
    data: {
      ...params
    }
  });
}
